<template>
  <div class="backView">
    <img class="imgBackView" :src="planInfo.pic">
    <div class="certView">
      <img v-if="planInfo.ext2 == '1'" class="certImgView" :src="planInfo.certInfo.pic">
      <div v-if="planInfo.ext2 == '1'" @click="submitBtnClick" class="btnView">
        <div v-if="planInfo.certInfo.isReceive === 1">查看证书</div>
        <div v-else-if="planInfo.planPassStatus === 1">领取证书</div>
        <div v-else>通关大考</div>
      </div>
    </div>
    <div class="infoView">
      <p class="nameLabel ellipsis1">{{planInfo.title}}</p>
      <p class="tagLabel ellipsis1">当前含{{planInfo.subjectCount || 0}}个课程 共{{planInfo.mediaCount || 0}}课时</p>
    </div>

  </div>
</template>

<script>
  export default {
    name: 'planTop-m',
    props: {
      planInfo: {
        default() {
          return {}
        }
      }
    },
    methods: {
      submitBtnClick() {
        this.$emit('sendCertClick')
      }

    }
  }
</script>

<style scoped>
  .backView {
    position: relative;
  }
  .imgBackView {
    width: 100%;
    height: auto;
  }
  .certView {
    position: absolute;
    left: 20px;
    top: 50%;
    width: 28%;
    transform: translate(0, -50%);
  }
  .certImgView {
    width: 100%;
    height: auto;
  }
  .btnView {
    margin-top: 10px;
    width: 100%;
    height: 32px;
    background: white;
    border-radius: 16px;
    font-family: PingFang-SC-Bold;
    font-size: 16px;
    color: #005BAB;
    line-height: 32px;
    text-align: center;
  }
  .infoView {
    width: 58%;
    text-align: right;
    position: absolute;
    right: 20px;
    bottom: 16px;
  }
  .nameLabel {
    font-family: PingFang-SC-Bold;
    font-size: 16px;
    color: white;
  }
  .tagLabel {
    margin-top: 8px;
    font-family: PingFang-SC-Medium;
    font-size: 12px;
    color: #FFFFFF;
  }

</style>
